
local cmdname = "aids_ban"

if CLIENT then
	
	local args = { { Name = "Aimbotting", Value = "Aimbotting." },
	{ Name = "Speedhacker", Value = "Speed Hacking." },
	{ Name = "Exploiter", Value = "Exploit Abuse." },
	{ Name = "Griefer", Value = "Griefing." },
	{ Name = "Asshole", Value = "Asshole." },
	{ Name = "Idiot", Value = "Idiot." } }
	
	AIDS.RegisterCommand( "Permaban", cmdname, "ban", args ) 

else
	
	local function BanPlayer( ply, cmd, args )
	
		local target = AIDS.GetPlayer( args[1] )
		
		if target and !target:IsAdmin() and !target:IsSuperAdmin() then
		
			local reason = ""
		
			for i=2, #args do
		
				reason = reason .. args[i]
		
			end
			
			AIDS.ChatPrint( { target, " was banned by ", ply, ": " .. reason } )
		
			if AIDS.Bans then
			
				table.insert( AIDS.Bans, { target:SteamID(), "(" .. target:Name() .. ") " .. reason } )
				
			else
			
				target:Ban( 0, "Banned: " .. reason )
			
			end
			
			target:Kick( "Banned: " .. reason )
		
		end
	
	end
	
	AIDS.AddCommand( BanPlayer, cmdname )
	
end